<template>
	<view>
		<!-- <view style="background-color: #f5f5f5 !important;">
			<u-tabs :list="tabs" bold='true' activeColor="#0B868E" :current="current" @change="changeTabs">
			</u-tabs>
		</view> -->
		<view class="list_content">
			<u-empty :show="showEmpty" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
			</u-empty>
			<view class="con_list u-border-bottom u-rela" v-for="(item,index) in list" :key="index" @click="togoodsDetail(item)">
				<view v-if="item.status==0" style="color:#f00;font-size: 26rpx;" class="u-abso pos_right">待审核</view>
				<view v-else-if="item.status==1" style="color:#00aa00;font-size: 26rpx;" class="u-abso pos_right">审核成功</view>
				<view v-else style="color:#ff5500;font-size: 26rpx;" class="u-abso pos_right">审核拒接</view>
				<image class="va_m" :src="item.image" mode="aspectFill"></image>
				<view class="dis_inl_blo con_intro va_m">
					<view class="title_name">{{item.name}}</view>
					<view class="person_con">
						<text>数量：{{item.num}}</text>
						<text class="u-margin-left-20">单价:{{item.unit}}</text>
					</view>
					<view class="price u-abso">
						<text>总价：<text style="color:red;font-size:32rpx;">￥{{item.price}}</text></text>
						<text class="time u-abso pos_right">{{$u.timeFormat(item.create_time, 'yyyy-mm-dd')}}</text>
						<!-- <text class="rubtn u-abso ">入库</text> -->
					</view>
				</view>
			</view>
		</view>
		<view class="fabu" @click="torelease">
			<image src="../../static/release.png" mode="heightFix"></image>
		</view>
	</view>
</template>

<script>
	import {
		getMyAssetsInOutLog
	} from "@/service/assetService.js";
	export default {
		data () {
			return {
				current: 0,
				type:0,
				tabs: [
					{
						name: '全部'
					},
					{
						name: '待审核'
					},
					{
						name: '待采购'
					},
					{
						name: '采购到货'
					}
				],
				showEmpty:false,
				list:[]
			}
		},
		onShow() {
			getMyAssetsInOutLog({type:0}).then(this.getMyAssetsInOutLog)
		},
		methods:{
			getMyAssetsInOutLog(e){
				if (e.code == 200) {
					
					this.showEmpty = false;
					this.list = e.result
				} else {
					this.showEmpty = true;
					this.list = [];
				}
			},
			togoodsDetail(item){
				uni.navigateTo({
					url:'./procurementDetail?item='+encodeURIComponent(JSON.stringify(item))
				})
				
			},
			torelease(){
				uni.navigateTo({
					url:'./procuremenRelease'
				})
			},
			changeTabs(e) {
				let par;
				this.current = e;
				switch (this.current) {
					case 0:
						par = {
							status: 0,
							type:this.value
						};
						break;
					case 1:
						par = {
							status: 2,
							type:this.value
						};
						break;
					case 2:
						par = {
							status: 1,
							type:this.value
						};
						break;
					case 3:
						par = {
							status: 3,
							type:this.value
						};
						break;
					case 4:
						par = {
							status: -1,
							type:this.value
						};
						break;
					default:
						par = {
							status: 0,
							type:this.value
						};
				}
				// getAdjacentTools(par).then(this.getAdjacentTools);
			},
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #f5f5f5;
	}
	.list_content{
		width:95%;
		margin:20rpx auto;
		// padding:20rpx;
		background-color: #fff;
		border-radius: 20rpx;
	}
	.con_list{
		padding:20rpx;
	}
	.con_list image{
		width:25%;
		height:180rpx;
		border-radius: 10rpx;
		vertical-align: top;
	}
	.con_intro{
		width:70%;
		margin-left:15rpx;
		vertical-align: top;
	}
	.person_con{
		margin-top:10rpx;
		font-size: 26rpx;
		color:#666;
	}
	.title_name{
		width:80%;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.price{
		width:70%;
		bottom:50rpx;
		font-size: 28rpx;
	}
	.detail{
		font-size: 26rpx;
		color:#0f848c;
		padding:3rpx 25rpx;
		border:1rpx solid #0f848c;
		border-radius: 18rpx;
	}
	.time{
		font-size: 24rpx;
		color:#666;
	}
	.fabu{
		position: fixed;
		bottom:150rpx;
		right:30rpx;
		width:100rpx;
		height:100rpx;
		// text-align: center;
		border-radius: 50%;
	}
	.fabu image{
		width:100rpx;
		height:100rpx;
	}
</style>